document.ready(function() {
	webSpinner.spin(getItem('loadSpin'));

    var from = getUrlParam('from');
    if (from != null && from != '') {
        setValue('from', from);
    }

    loadReportBar();

    loadFocusBar();
    queryKey('ok');
});

function queryKey(flag) {
    var param = {};
    param.team = 'platform';
    param.ctrl = 'other';
    param.func = 'getOtherInfo';
    param.otherid = getUrlParam('otherid');

    sendAjax(param, function(result) {
        other.info = result.otherInfo;

        setDisplay('loadSpin', 'none');
        setDisplay('mainBg', '');
        webSpinner.spin();
    });
}

function toBack() {
    if (getValue('from') == 'list') {
        toUrl('index.php?m=other&c=list');
    }
    else if (getValue('from') == 'wx') {
        toUrl('index.php?m=other&c=list');
    }
    else {
        toUrl('index.php?m=showpage&c=home');
    }
}

function showSwiperPic() {
    var div = document.querySelectorAll('.pos1');
    var img = document.querySelectorAll('.pos2');

    if (getValue('imgstatus') == 'small') {
        setClass('swiperBar', 'swiper-container mask-swiper-div mask-middle');

        for (var i = 0; i < div.length; i++) {
            div[i].className = 'swiper-slide mask-middle pos1';
            img[i].className = 'swiper-slide swiper-img3 pos2';
        }

        document.body.style.overflow = 'hidden';
        setValue('imgstatus', 'big');
    }
    else {
        setClass('swiperBar', 'swiper-container');

        for (var i = 0; i < div.length; i++) {
            div[i].className = 'swiper-slide swiper-img1 pos1';
            img[i].className = 'swiper-slide swiper-img2 pos2';
        }

        document.body.style.overflow = 'visible';
        setValue('imgstatus', 'small');
    }
}

function call(phone) {
    toUrl('tel:' + phone);

    var param = {};
    param.team = 'platform';
    param.ctrl = 'other';
    param.func = 'setOtherDial';
    param.otherid = getAjaxValue('otherid');

    sendAjax(param, function(result) {
        //不需要对返回做处理
    });
}

function slipedit_submit(flag) {
    if (flag == 'report') {
        submitReport(getValue('otherid'), 'other');
    }
}

function openMap(position) {
    if (position == null || position == '') {
        showTip('地图待完善中');
        return;
    }

    openSlipIframeDiv('index.php?m=other&c=map&position=' + position);
}

function viewIntroduce() {
    openSlipDetailsDiv(getHtml('introduceBar'));
}